package ch4;

import java.util.Scanner;

public class GetAvg {

	public static void main(String[] args) {
		// 输入5门课，求平均分
		double sum = 0;
		double avg = 0;
		Scanner in = new Scanner(System.in);
		for (int i = 1; i <= 5; i++) {
			System.out.print("请输入第" + i + "门课的成绩：");
			double t = in.nextDouble();
			sum += t;
			// sum += in.nextDouble();
		}
		avg = sum / 5;
		System.out.println("平均分是：" + avg);
	}

}
